/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package queenb.web.util;

import java.sql.SQLException;
import java.util.List;
import javax.faces.model.SelectItem;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.Param;
import queenb.web.exception.NoDataEffectException;

import queenb.web.store.CombCurpks;


/**
 * @author  : linhlv
 * @package : queenb.web.util
 * @file    : LoadListItems.java
 * @created : Oct 18, 2010
 * @purpose :
 */
public class LoadListItems {
    

    public  List<SelectItem> loadS200(int pnfh000, int pnfh200, String pvLOGIN) throws NoDataEffectException, SQLException, InstantiationException, IllegalAccessException{
        CombCurpks store = new CombCurpks(PackageContants.ADMIN_TOOLS_CHECKUSERLOGIN);
        Param[] p={
            new Param(OracleTypes.INTEGER, pnfh000),
            new Param(OracleTypes.INTEGER, pnfh200),            
            new Param(OracleTypes.CHAR, pvLOGIN),
        };
        List<SelectItem> si=store. getListSelectItems(p);
        if (si==null || si.isEmpty()){
            String message = String.format("no product of order has FH200=%d, FH000=%d", pnfh200, pnfh000);
           throw new NoDataEffectException(message);
        }
        return si;
    }



}